Stop! Have you configured your OIDC providers in the Builder using the instructions linked above? Have you added your client id(s) to the SequenceConfig scriptable object in your Resources folder?
Once the user successfully signs in, an idToken is returned via deep link to the application.
In order to enable deep linking, we must register a custom URL scheme for our application. There are some platform specific requirements to set this up.
For social sign in to work in the editor, you will need to deploy a simple server on your local machine. We provide a sample implementation here.To deploy this sample server, please perform the following.
You should see Server listening on port 8080 printed to your terminal/command prompt
If you choose to deploy the server to somewhere else (a different port, a public server, etc.), you’ll want to change the OpenIdAuthenticator.RedirectUrl in your code before initiating the sign in process
OpenIdAuthenticator.InjectRedirectUrl("the url for your deployed server");
Note: you’ll want to use a web client for your social sign in provider with http://localhost:8080/ (or your server url) whitelisted as a redirect url under Standalone Platforms in SequenceConfig
When configuring your social sign in web client credentials with Google (for example) for desktop platforms (and Android), you’ll want to whitelist https://api.sequence.app/oauth/callback as “Authorized redirect URIs”
In the Project window, browse to Assets > Plugins > Android.
a) Note: in Unity versions 2021.2 and up this path doesn’t exist by default. Please navigate to Edit > Project Settings > Player and under the Android Publishing Settings, enable Custom Main Manifest in the Build section. See https://docs.unity3d.com/Manual/deep-linking-android.html for more info.
If it doesn’t already exist, create a new file and name it AndroidManifest.xml.
Paste the following XML into the file, or, if you already have one, add the new keys from this XML to it.
Make sure to replace ‘sdk-powered-by-sequence’ with the Url Scheme you set in SequenceConfig
<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" > <application> <activity android:name="com.unity3d.player.UnityPlayerActivity" android:theme="@style/UnityThemeSelector" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> <intent-filter> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.BROWSABLE" /> <data android:scheme="sdk-powered-by-sequence"/> <!-- substitute 'sdk-powered-by-sequence' with the Url Scheme you set in `SequenceConfig` --> </intent-filter> </activity> </application> </manifest>
b) Note: Unity 2022 versions prior to 2022.3.7f1 and 2023 versions prior to 2023.1.7f1, 2023.2.0b3, or 2023.3.0a1 contain a bug with Android deep-linking. Please use this XML instead.
<?xml version="1.0" encoding="utf-8"?><manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools"> <application> <activity android:name="com.unity3d.player.UnityPlayerActivity" android:theme="@style/UnityThemeSelector" android:exported="true"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> <meta-data android:name="unityplayer.UnityActivity" android:value="true" /> <intent-filter> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.BROWSABLE" /> <data android:scheme="sdk-powered-by-sequence"/> <!-- substitute 'sdk-powered-by-sequence' with the Url Scheme you set in `SequenceConfig` --> </intent-filter> </activity> </application></manifest>
The URL Scheme in your AndroidManifest and SequenceConfig should be all lowercase.
If you’re working with Unity 6, you may need to replace UnityPlayerActivity in your AndroidManifest with UnityPlayerGameActivity! You may also need to replace your android:theme; we’ve found “@style/BaseUnityGameActivityTheme” works well in our testing.
Social sign in on Web platforms uses React via the WebGLTemplate found under WebGLTemplates/SequenceReact. This has been validated on WebGL and WebGPU. To learn how to enable WebGPU in Unity, please see this forum post.Please note that Google is the only OIDC provider currently supported on Web platforms by our default SequenceReact WebGLTemplate; however, you are welcome to expand upon it to add support for the other OIDC providers supported by our API.
Drag this WebGLTemplates folder under Assets (or just drag the SequenceReact template into your existing WebGLTemplates folder is you already have one) such that you have Assets/WebGLTemplates/SequenceReact.
It is very important that your WebGLTemplates are at Assets/WebGLTemplates. Much like the Plugins folder, if they aren’t in this exact location, Unity will not pick them up!
Once you’ve added the SequenceReact template, you’ll want to restart the editor so that Unity picks up your newly added template.From here, you can select the template under Project Settings > Player Settings > Resolution and Presentation.
When building your WebGL app, if you are using any Compression Format (e.g. Gzip or Brotli), it is recommended to enable Decompression Fallback under Player Settings > Publishing Settings. Learn more about WebGL deployment here: https://docs.unity3d.com/Manual/webgl-deploying.html
When configuring your social sign in credentials with Google (for example), you’ll want to whitelist http://localhost:4444 and your game’s eventual hosted URL as “Authorized Javascript origins”
Don’t forget to subscribe to the SequenceWallet.OnWalletCreated event to receive your newly created wallet!